//
//  MyTableViewCell.m
//  LazyCat
//
//  Created by zhanshu on 15/9/7.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//

#import "MyTableViewCell.h"

@implementation MyTableViewCell


- (IBAction)cellButtonAction:(id)sender {
    if ([_delegate respondsToSelector:@selector(tableViewCell:btn:)]) {
        [_delegate tableViewCell:self btn:sender];
    }
}
- (void)drawRect:(CGRect)rect {
    CGRect fm = [self frame];
    self.imgOne.frame = CGRectMake((ScreenWidth/2 - 94)/2, (fm.size.height-94)/2, 94, 94);
    self.imgTwo.frame = CGRectMake((ScreenWidth/2 - 94)/2+ScreenWidth/2, (fm.size.height-94)/2, 94, 94);
    self.middleLabel.frame = CGRectMake(ScreenWidth/2, 0, 0.5, fm.size.height);
    self.middleLabel.backgroundColor = SetColor(225, 225, 225, 1);
    self.botomLabel.frame = CGRectMake(0, fm.size.height-0.5, ScreenWidth, 0.5);
    self.botomLabel.backgroundColor = SetColor(225, 225, 225, 1);
    self.mesgLabel.frame = CGRectMake(ScreenWidth/4 * 3 + 5, fm.size.height/2 - 94/2 + 15, 20, 20);
}
- (void)awakeFromNib {
    self.mesgLabel.backgroundColor = [UIColor redColor];
    self.mesgLabel.text = @"3";
    self.mesgLabel.font = [UIFont systemFontOfSize:12];
    self.mesgLabel.textAlignment = NSTextAlignmentCenter;
    self.mesgLabel.textColor = [UIColor whiteColor];
    self.mesgLabel.layer.cornerRadius = 10.0;
    self.mesgLabel.layer.masksToBounds = YES;
    if ([self.mesgLabel.text isEqualToString:@"0"]) {
        self.mesgLabel.hidden = YES;
    }else {
        self.mesgLabel.hidden = NO;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
